<?php

class Default_Form_Login extends VC_Form
{

    public function init()
    {
        $username = $this->addElement('text', 'username', array(
                    'filters' => array('StringTrim', 'StringToLower'),
                    'required' => true,
                    'label' => $this->translate->_("Your email:"),
                ));

        $password = $this->addElement('password', 'password', array(
                    'filters' => array('StringTrim'),
                    'validators' => array(
                        'Alnum',
                        array('StringLength', false, array(3, 20)),
                    ),
                    'required' => true,
                    'label' => $this->translate->_("Password:"),
                ));

        $login = $this->addElement('submit', 'login', array(
                    'required' => false,
                    'ignore' => true,
                    'label' => $this->translate->_("Login"),
                ));

        // We want to display a 'failed authentication' message if necessary;
        // we'll do that with the form 'description', so we need to add that
        // decorator.
        $this->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
            array('Description', array('placement' => 'prepend')),
            'Form'
        ));
    }

}